<?php
require_once ROOT_DIR . 'module/ModuleBase.php';

class RunnerPic extends ModuleBase
{
	protected $_table = 'runnerpic';
	
	public function addRunnerPic($runnerIdAry, $weibo_id)
	{
		if (!$runnerIdAry || !is_array($runnerIdAry)){
			return false;
		}
		
		if (!$weibo_id){
			return false;
		}
		$sql = "insert $this->_table(runner_id,weibo_id)values";
		$values = array();
		foreach ($runnerIdAry as $rid){
			$values[] = "('" . mysql_escape_string($rid) . "'," . $weibo_id . ")";
		}
		$sql .= implode(',', $values);
		return $this->query($sql);
	}
}